<!--
  @author heguanghua
  @since 2019/06/12 19:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
        <th lay-data="{field:'relateId', width:120, unresize:true, align:'center',hide:'true'}">relateId</th>
        <th lay-data="{field:'plat', width:120, unresize:true, align:'center'}">平台</th>
        <th lay-data="{field:'deptId', width:260, unresize:false, align:'center'}">部门</th>
        <th lay-data="{field:'content', unresize:true, align:'center'}">公告内容</th>
        <th lay-data="{field:'status', width:80, unresize:true, align:'center'}">状态</th>
        <th lay-data="{field:'updateTime', width:230, unresize:true, align:'center'}">最近操作时间/人</th>
        <th lay-data="{field:'操作',width:100, unresize:true, align:'center', fixed:'right'}">操作</th>
    </tr>
    </thead>

    <tbody>
    <tr th:each="item:${items}">
        <td></td>
        <td th:text="${item.relateId}">relateId</td>
        <td th:text="${T(com.zmn.common.constant.GlobalConsts).getPlatName(item.plat)}">plat</td>
        <td th:text="${item.deptUnionName}" class="">deptUnionName</td>
        <td th:text="${item.content}" class="layui-gray">content</td>
        <td>
            <div th:onmouseover="|show_tips(${(#authPermit.checkPermit('/notice/updateStatus.action'))},'请先开启开关权限',this)|">
                <input th:disabled="${(#authPermit.checkPermit('/notice/updateStatus.action'))?'false':'true'}" type="checkbox" name="status" id="status" th:key="${item.relateId}" th:value="${item.status}"
                       lay-text="ON|OFF" lay-skin="switch" lay-filter="status" th:checked="${item.status == 2}"/>
            </div>
        </td>
        <td th:text="${(item.updateTime==null?'':#dates.format(item.updateTime, 'yyyy-MM-dd HH:mm:ss'))+'/'+(item.updater==null?'':item.updater)}">updateTime</td>
        <td>
            <div>
                <a th:if="${#authPermit.checkPermit('/notice/detail.action')}" style="color: #00a0e9"
                   th:onclick="modifyNotice([[${item.relateId}]])" href="#"
                   lay-text="修改" text="修改">修改</a>
                <a th:if="${#authPermit.checkPermit('/notice/delete.action')}" style="color: #00a0e9"
                   th:onclick="deleteNotice([[${item.relateId}]])" href="#"
                   lay-text="删除" text="删除">删除</a>
            </div>
        </td>
    </tr>
    </tbody>
</table>
